package com.quanquan.store.entity;

import lombok.Data;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 功能描述:秒杀功能实体
 *
 * @ClassName: ShoppingKill
 * @Author: xiaoqianh丶
 * @Date: 2019-06-29 14:25
 * @Version: V1.0
 */
@Data
@Entity
@Table(name = "oo_shoping_kill")
public class ShoppingKill implements Serializable {

    private static final long serialVersionUID = 1L;


    @Id
    @Column(name = "id", unique = true, length = 64)
    private String id;


    /**
     * 秒杀活动名称
     */
    @Column(name = "shopping_kill_name", length = 32)
    private String shoppingKillName;

    /**
     * 秒杀开始时间
     **/
    @Column(name = "start_time", nullable = false, length = 32)
    private String startTime;


    /**
     * 秒杀结束时间
     **/
    @Column(name = "end_time", nullable = false, length = 32)
    private String endTime;


    /**
     * 商品库存
     */
    @Column(name = "inventory", columnDefinition = "INT")
    private Integer inventory;

    /**
     * 秒杀价格
     */
    @Column(name = "price", columnDefinition = "DOUBLE")
    private Double price;

    /**
     * 原价
     */
    @Column(name = "original_price", length = 32)
    private String originalPrice;


    /**
     * 秒杀价格(积分)
     */
    @Column(name = "integral", columnDefinition = "INT")
    private Integer integral;

    /**
     * 原价(积分)
     */
    @Column(name = "original_integral", length = 32)
    private String originalIntegral;

    /**
     * 是否包邮
     */
    @Type(type = "yes_no")
    @Column(name = "STATUS_MAIL")
    private Boolean packageMail;


    /**
     * 秒杀商品分面
     */
    @Column(name = "cover_url", length = 255)
    private String coverUrl;

    /**
     * 秒杀商品(保存对应商品的id)
     */
    @Column(name = "shopping_kill_goods", length = 64)
    private String shoppingKillGoods;

    /**
     * 是否显示 0是显示 1是不显示
     */
    @Column(name = "status_show", columnDefinition = "INT default 0", nullable = false)
    private Integer show;


    /**
     * 是否删除 0 不删除 1 删除
     */
    @Column(name = "remove", columnDefinition = "INT default 0", nullable = false)
    private Integer remove;


    @Column(name = "share_url", length = 255)
    private String shareUrl;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false, length = 32)
    private String createTime;

    /**
     * 秒杀商品的类型 (goods,coupon  商品，优惠券)
     */
    @Column(name = "goods_type",length = 32)
    private String goodsType;

    /**
     * 秒杀商品状态 preparing：准备中  processing ：进行中  over：已经结束
     */
    @Column(name = "kill_status",length = 32)
    private String killStatus;


    /**
     * 秒杀商品介绍
     **/
    @Column(name = "content", columnDefinition = "TEXT")
    private String content;

    /**
     * 使用规则
     **/
    @Column(name = "use_rule",length = 256)
    private String useRule;


    /**
     *支付类型  integral 积分  money 现金
     **/
    @Column(name = "pay_type",length = 64)
    private String payType;


    /**
     * 抢购次数是否限制次数 0 不限，1限制
     */
    @Column(name = "status_num_limit", columnDefinition = "INT default 0", nullable = false)
    private Integer statusNumLimit;


    /**
     * 抢购次数是否限制次数 0 不限，1限制
     */
    @Column(name = "status_daily", columnDefinition = "INT default 0", nullable = false)
    private Integer statusDaily;


    /**
     * 秒杀限制的次数
     */
    @Column(name = "shopkill_times", columnDefinition = "INT default 1", nullable = false)
    private Integer shopKillTimes;

    /**
     * 倒计时
     */
    @Transient
    private Long countdown;

    /**
     * 剩余库存
     */
    @Transient
    private Integer remainingInventory;

}
